home *** CD-ROM | disk | FTP | other *** search
- #include <math.h>
-
- BOOL IO_boucle();
- void update_color(int&, int&);
- void circle_param(int, int, int, int&, int&, float);
-
- BOOL IO_boucle()
- {
- BOOL pause=FALSE, close=FALSE;
- Emperor_Input=0L;
- //do
- //{
- while((Emperor_Input = RA_HandleInput(WindowObject1, &Emperor_Code)) != WMHI_LASTMSG)
- {
- switch(Emperor_Input & WMHI_CLASSMASK)
- {
- case WMHI_GADGETUP:
- switch(Emperor_Input & WMHI_GADGETMASK)
- {
- /*case 15:
- if(pause==TRUE)
- {
- pause=FALSE;
- }
- else
- {
- pause=TRUE;
- }
- break;*/
- case 12:
- //SetGadgetAttrs(Button3, Window1, NULL, GA_Selected, FALSE, TAG_DONE);
- Emperor_SetGadgetAttr(String1, " ");
- //pause=FALSE;
- close=TRUE;
- return close;
- break;
- default:
- //pause=FALSE;
- break;
- }
- default:
- //pause=FALSE;
- break;
- }
- }
- //}
- //while(pause==TRUE);
- }
-
- void update_color()
- {
-
- }
-
- void circle_param(int tempr, int i, int j, int& x, int& y, float alpha)
- {
- float tempx=0.0, tempy=0.0, arrx=0.0, arry=0.0;
- tempx = tempr * cos(alpha);
- arrx = floor(tempx);
- if((tempx-arrx)<0.5)
- {
- tempx=floor(tempx);
- }
- else
- {
- tempx=ceil(tempx);
- }
- tempy = tempr * sin(alpha);
- arry = floor(tempy);
- if((tempy-arry)<0.5)
- {
- tempy=floor(tempy);
- }
- else
- {
- tempy=ceil(tempy);
- }
- x = i + int(tempx);
- y = j + int(tempy);
- }
-